<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>
<body>
    <script>
        var person = {
            name: '刘传',
            sex: '男',
            age: '100岁',
            say: function () {
                console.log('我是谁?')
            }
        };
        function Person(name,sex,age) {
            this.name = name;
            this.sex = sex;
            this.age = age;
            this.say = function () {
                console.log('我是谁？');
            }
        }
        Person.prototype.work = function () {
            console.log('开飞机');
        }
        var liuchuan = new Person();
        function PersonX(name,sex,age) {
            var obj = new Object();
            obj.name = name;
            obj.sex = sex;
            obj.age = age;
            obj.say = function () {
                console.log('开飞机');
            }
            return obj;
        }
        PersonX('刘传','男',18);
    </script>
</body>
</html>